package com.chinawayltd.ews.sample.job;

import com.chinawayltd.ews.sample.service.SynchroVehicleStatisticsService;
import com.chinawayltd.ews.sample.taskCenter.TaskJob;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: greeProject-timingTaskCenter
 * @description 车辆油耗数据同步任务
 * @author: chenxin
 * @create: 2018年4月25日 下午3:16:39
 */
@Component
public class SynchroVehicleStatisticsJob implements TaskJob {
    private static Logger logger = LoggerFactory.getLogger(SynchroVehicleStatisticsJob.class);
    @Autowired
    private SynchroVehicleStatisticsService synchroVehicleStatisticsService;


    @Override
    public void doJob(JobExecutionContext context) {
        try {
            synchroVehicleStatisticsService.generateVehicleStatisticsData();
        } catch (Exception e) {
            logger.error("油耗同步定时器执行时发生错误！", e);
        }
    }

}
